<template>
  <div class="about">
    <k-form :model="form" :rules="rules" >
      <k-form-item label="用户名" prop="username">
        <k-input v-model="form.username"></k-input>
    </k-form-item>
    <k-form-item label="密码" prop="password">
        <k-input v-model="form.password" type="password"></k-input>
    </k-form-item>
    <k-form-item>
        <button type="button" @click="submit">提交</button>
    </k-form-item>
    </k-form>
    <hr />
  <el-form :model="form" :rules="rules" >
      <el-form-item label="用户名" prop="username">
        <el-input v-model="form.username"></el-input>
    </el-form-item>
    <el-form-item label="密码" prop="password">
        <el-input v-model="form.password" type="password"></el-input>
    </el-form-item>
    <el-form-item>
        <el-button type="submit">提交</el-button>
    </el-form-item>
  </el-form>
  </div>
</template>
<script>
  import KForm from '../components/KForm';
  import KFormItem from '../components/KFormItem';
  import KInput from '../components/KInput';
  export default {
    components: {
      KInput, KForm, KFormItem
    },
    data(){
      return {
        form: {
          username: '',
          password: ''
        },
        rules: {
          username: [
                { required: true, message: '请输入用户名' }
              ],
              password: [
                { required: true, message: '请输入密码' }
              ]
        }
      }
    },
    methods: {
      submit(){
        console.log(this.form);
      }
    }
  }
</script>